Extension point actions
Documentation
An action is defined by the following properties:
- id: string identifying the action
- label: the action name
- help: the action help message
- link: string representing the command the action will trigger
- category: a string useful to group actions that will be rendered in the same area of a page. An action can define several categories.
- filter-ids: id of a filter that will be used to control the action visibility. An action can have several filters: it is visible if all its filters grant the access.
- filter: a filter definition can be done directly within the action definition. It is a filter like others and can be referred by other actions.
- icon: the optional icon path for this action
- confirm: an optional javascript confirmation string that can be triggered when executing the command.
- enabled: boolean indicating whether the action is currently active. This can be used to hide existing actions when customizing the site behaviour.
- order: an optional integer used to sort actions within the same category. This attribute may be depracated in the future.
- immediate: an optional boolean (available since 5.4.2) that makes it possible to call command actions without validating the enclosing form.
- type: the UI type action (available since 5.6)
UI Type properties, defined within a "properties" tag: - property: the property value - name: the property name
Properties also accept list or map-like values.
Before 5.6, it is important to understand that an action does *not* define the way it will be rendered: this is left to pages, templates and other components displaying it. Most of the time, actions will be rendered as command link or command buttons.
Since 5.6, the template /incl/action/generic_action_template.xhtml handles rendering of an action depending on its type.
Examples:
<action enabled="true" icon="/icons/file.gif" id="TAB_RIGHTS"
label="action.view.rights"
link="/incl/tabs/document_rights.xhtml" type="fancybox">
<category>VIEW_ACTION_LIST</category>
<filter-id>rights</filter-id>
<properties>
<property name="url">/incl/fancybox.xhtml</property>
<propertyList name="myListProp">
<value>item1</value>
<value>item2</value>
</propertyList>
<propertyMap name="myMapProp">
<property name="mySubProp">mySubPropValue</property>
</propertyMap>
</properties>
</action>
<action enabled="true" icon="/icons/action_add_file.gif"
id="newFile" label="action.new.file" link="create_file" type="button">
<category>SUBVIEW_UPPER_LIST</category>
<filter-id>create</filter-id>
</action>
<action enabled="true" icon="/icons/action_add.gif" id="newSection"
label="command.create.section"
link="#{documentActions.createDocument('Section')}" type="icon">
<category>SUBVIEW_UPPER_LIST</category>
<filter id="newSection">
<rule grant="true">
<permission>AddChildren</permission>
<type>SectionRoot</type>
</rule>
</filter>
</action>
Actions extension point provides mergeing features: you can change an existing action definition in your custom extension point provided you use the same identifier.
Contribution Descriptors
- Class: org.nuxeo.ecm.platform.actions.Action
Existing Contributions
Contributions are presented in the same order as the registration order on this extension point. This order is displayed before the contribution name, in brackets.
-
<extension point="actions" target="org.nuxeo.ecm.platform.actions.ActionService"> <action id="webui" label="WEBUI" link="ui" order="90" type="bare_link"> <category>MAIN_TABS</category> </action> </extension>